#include "network-error-handler-server.hh"

NetworkErrorHandlerServer::NetworkErrorHandlerServer ():
  NetworkErrorHandler ()
{
}

boost::shared_ptr<Request>
NetworkErrorHandlerServer::readFail (const std::exception& e)
{
  std::cout << "ERROR while trying to read on socket: " << e.what () << std::endl;
  return boost::shared_ptr<Disconnection> (new Disconnection ());
}

boost::shared_ptr<Request>
NetworkErrorHandlerServer::readWrongSize (int numread, int toread)
{
  std::cout << "numread = " << numread << " toread = " << toread << std::endl;
  assert (false);

  //just to prevent any warning, will never be executed
  return boost::shared_ptr<Disconnection> (new Disconnection ());
}

std::string
NetworkErrorHandlerServer::rawReadFail (const std::exception& e)
{
  std::cout << "ERROR while trying to raw_read on socket: " << e.what () << std::endl;
  return "";
}

void
NetworkErrorHandlerServer::sendFail (const std::exception& e)
{
  std::cout << "ERROR while trying to write on socket: " << e.what () << std::endl;
  return;
}
